home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsNetError.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  10KB  |  321 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is Mozilla.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Netscape Communications Corporation.
  18.  * Portions created by the Initial Developer are Copyright (C) 2002
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *   Darin Fisher <darin@netscape.com> (original author)
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsNetError_h__
  39. #define nsNetError_h__
  40.  
  41. #include "nsError.h"
  42.  
  43.  
  44. /* NETWORKING ERROR CODES */
  45.  
  46.  
  47. /******************************************************************************
  48.  * General async request error codes:
  49.  * 
  50.  * These error codes are commonly passed through callback methods to indicate
  51.  * the status of some requested async request.
  52.  *
  53.  * For example, see nsIRequestObserver::onStopRequest.
  54.  */
  55.  
  56. /**
  57.  * The async request completed successfully.
  58.  */
  59. #define NS_BINDING_SUCCEEDED \
  60.     NS_OK
  61.  
  62. /**
  63.  * The async request failed for some unknown reason.
  64.  */
  65. #define NS_BINDING_FAILED \
  66.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 1)
  67.  
  68. /**
  69.  * The async request failed because it was aborted by some user action.
  70.  */
  71. #define NS_BINDING_ABORTED \
  72.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
  73.  
  74. /**
  75.  * The async request has been "redirected" to a different async request.
  76.  * (e.g., an HTTP redirect occured).
  77.  *
  78.  * This error code is used with load groups to notify the load group observer
  79.  * when a request in the load group is redirected to another request.
  80.  */
  81. #define NS_BINDING_REDIRECTED \
  82.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 3)
  83.  
  84. /**
  85.  * The async request has been "retargeted" to a different "handler."
  86.  *
  87.  * This error code is used with load groups to notify the load group observer
  88.  * when a request in the load group is removed from the load group and added
  89.  * to a different load group.
  90.  */
  91. #define NS_BINDING_RETARGETED \
  92.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 4)
  93.  
  94.  
  95. /******************************************************************************
  96.  * Miscellaneous error codes:
  97.  *
  98.  * These errors are not typically passed via onStopRequest.
  99.  */
  100.  
  101. /**
  102.  * The URI is malformed.
  103.  */
  104. #define NS_ERROR_MALFORMED_URI \
  105.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 10)
  106.  
  107. /**
  108.  * The URI scheme corresponds to an unknown protocol handler.
  109.  */
  110. #define NS_ERROR_UNKNOWN_PROTOCOL \
  111.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
  112.  
  113. /**
  114.  * Returned from nsIChannel::asyncOpen to indicate that OnDataAvailable will
  115.  * not be called because there is no content available.
  116.  *
  117.  * This is used by helper app style protocols (e.g., mailto).
  118.  *
  119.  * XXX perhaps this should be a success code.
  120.  */
  121. #define NS_ERROR_NO_CONTENT \
  122.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 17)
  123.  
  124. /**
  125.  * The requested action could not be completed while the object is busy.
  126.  *
  127.  * Implementations of nsIChannel::asyncOpen will commonly return this error
  128.  * if the channel has already been opened (and has not yet been closed).
  129.  */
  130. #define NS_ERROR_IN_PROGRESS \
  131.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 15)
  132.  
  133.  
  134. /******************************************************************************
  135.  * Connectivity error codes:
  136.  */
  137.  
  138. /**
  139.  * The connection is already established.
  140.  * XXX currently unused - consider removing.
  141.  */
  142. #define NS_ERROR_ALREADY_CONNECTED \
  143.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 11)
  144.  
  145. /**
  146.  * The connection does not exist.
  147.  * XXX currently unused - consider removing.
  148.  */
  149. #define NS_ERROR_NOT_CONNECTED \
  150.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 12)
  151.  
  152. /**
  153.  * The connection attempt failed, for example, because no server was listening
  154.  * at specified host:port.
  155.  */
  156. #define NS_ERROR_CONNECTION_REFUSED \
  157.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 13)
  158.  
  159. /**
  160.  * The connection attempt to a proxy failed.
  161.  */
  162. #define NS_ERROR_PROXY_CONNECTION_REFUSED \
  163.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 72)
  164.  
  165. /**
  166.  * The connection was lost due to a timeout error.
  167.  */
  168. #define NS_ERROR_NET_TIMEOUT \
  169.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 14)
  170.  
  171. /**
  172.  * The requested action could not be completed while the networking library
  173.  * is in the offline state.
  174.  */
  175. #define NS_ERROR_OFFLINE \
  176.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 16)
  177.  
  178. /**
  179.  * The requested action was prohibited because it would have caused the
  180.  * networking library to establish a connection to an unsafe or otherwise
  181.  * banned port.
  182.  */
  183. #define NS_ERROR_PORT_ACCESS_NOT_ALLOWED \
  184.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 19)
  185.  
  186. /**
  187.  * The connection was established, but no data was ever received.
  188.  */
  189. #define NS_ERROR_NET_RESET \
  190.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 20)
  191.  
  192. /**
  193.  * The connection was established, but the data transfer was interrupted.
  194.  */
  195. #define NS_ERROR_NET_INTERRUPT \
  196.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 71)
  197.  
  198. // XXX really need to better rationalize these error codes.  are consumers of
  199. //     necko really expected to know how to discern the meaning of these??
  200.  
  201.  
  202. /**
  203.  * This request is not resumable, but it was tried to resume it, or to
  204.  * request resume-specific data.
  205.  */
  206. #define NS_ERROR_NOT_RESUMABLE \
  207.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 25)
  208.  
  209. /**
  210.  * It was attempted to resume the request, but the entity has changed in the
  211.  * meantime.
  212.  */
  213. #define NS_ERROR_ENTITY_CHANGED \
  214.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 32)
  215.  
  216. /**
  217.  * The request failed as a result of a detected redirection loop.
  218.  */
  219. #define NS_ERROR_REDIRECT_LOOP \
  220.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 31)
  221.  
  222.  
  223. /******************************************************************************
  224.  * FTP specific error codes:
  225.  *
  226.  * XXX document me
  227.  */
  228.  
  229. #define NS_ERROR_FTP_LOGIN \
  230.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 21)
  231.  
  232. #define NS_ERROR_FTP_CWD \
  233.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 22)
  234.  
  235. #define NS_ERROR_FTP_PASV \
  236.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 23)
  237.  
  238. #define NS_ERROR_FTP_PWD \
  239.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 24)
  240.  
  241. #define NS_ERROR_FTP_LIST \
  242.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 25)
  243.  
  244. /******************************************************************************
  245.  * DNS specific error codes:
  246.  */
  247.  
  248. /**
  249.  * The lookup of a hostname failed.  This generally refers to the hostname
  250.  * from the URL being loaded.
  251.  */
  252. #define NS_ERROR_UNKNOWN_HOST \
  253.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 30)
  254.  
  255. /**
  256.  * The lookup of a proxy hostname failed.
  257.  *
  258.  * If a channel is configured to speak to a proxy server, then it will
  259.  * generate this error if the proxy hostname cannot be resolved.
  260.  */
  261. #define NS_ERROR_UNKNOWN_PROXY_HOST \
  262.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 42)
  263.  
  264.  
  265. /******************************************************************************
  266.  * Socket specific error codes:
  267.  */
  268.  
  269. /**
  270.  * The specified socket type does not exist.
  271.  */
  272. #define NS_ERROR_UNKNOWN_SOCKET_TYPE \
  273.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 51)
  274.  
  275. /**
  276.  * The specified socket type could not be created.
  277.  */
  278. #define NS_ERROR_SOCKET_CREATE_FAILED \
  279.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 52)
  280.  
  281.  
  282. /******************************************************************************
  283.  * Cache specific error codes:
  284.  *
  285.  * XXX document me
  286.  */
  287.  
  288. #define NS_ERROR_CACHE_KEY_NOT_FOUND \
  289.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 61)
  290.  
  291. #define NS_ERROR_CACHE_DATA_IS_STREAM \
  292.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 62)
  293.  
  294. #define NS_ERROR_CACHE_DATA_IS_NOT_STREAM \
  295.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 63)
  296.  
  297. #define NS_ERROR_CACHE_WAIT_FOR_VALIDATION \
  298.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 64)
  299.  
  300. #define NS_ERROR_CACHE_ENTRY_DOOMED \
  301.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 65)
  302.  
  303. #define NS_ERROR_CACHE_READ_ACCESS_DENIED \
  304.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 66)
  305.  
  306. #define NS_ERROR_CACHE_WRITE_ACCESS_DENIED \
  307.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 67)
  308.  
  309. #define NS_ERROR_CACHE_IN_USE \
  310.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 68)
  311.  
  312. /**
  313.  * Error passed through onStopRequest if the document could not be fetched
  314.  * from the cache.
  315.  */
  316. #define NS_ERROR_DOCUMENT_NOT_CACHED \
  317.     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 70)
  318.  
  319.  
  320. #endif // !nsNetError_h__
  321.